package Main;

public class GameTimer {
	public static int TIMER_MODIFIER = 1000;
	private long CurrentTime;	// milliseconds
	private long GameTime;		// in seconds
	private long StartValue;	// ms
	private long PauseValue;	// ms
	private boolean Paused;

	public GameTimer() {
		CurrentTime = 0;
		Paused = true;
	}

	public void destroy() {

	}

	public void TogglePaused() {
Paused = !Paused;
	}

	public void StartTimer() {
		StartValue = System.currentTimeMillis();
		CurrentTime = System.currentTimeMillis();
		Paused = false;
	}

	public void UpdateTiimer() {
		if ( Paused == false )
		{
			CurrentTime = System.currentTimeMillis();
		}
		else {
			PauseValue = System.currentTimeMillis() - CurrentTime;
		}
		GameTime = (((CurrentTime - StartValue) - PauseValue )/ TIMER_MODIFIER);
	}

	public long GetGameTime() {
		return GameTime;
	}

}
